<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Direct3D 12 Memory Allocator: D3D12MA::DefragmentationContext Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Direct3D 12 Memory Allocator
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_d3_d12_m_a.html">D3D12MA</a></li><li class="navelem"><a class="el" href="class_d3_d12_m_a_1_1_defragmentation_context.html">DefragmentationContext</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_d3_d12_m_a_1_1_defragmentation_context-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">D3D12MA::DefragmentationContext Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Represents defragmentation process in progress.  
 <a href="#details">More...</a></p>

<p><code>#include &lt;D3D12MemAlloc.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for D3D12MA::DefragmentationContext:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_d3_d12_m_a_1_1_defragmentation_context.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1606c015d02edc094bb246986159d592" id="r_a1606c015d02edc094bb246986159d592"><td class="memItemLeft" align="right" valign="top">HRESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1606c015d02edc094bb246986159d592">BeginPass</a> (<a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___p_a_s_s___m_o_v_e___i_n_f_o.html">DEFRAGMENTATION_PASS_MOVE_INFO</a> *pPassInfo)</td></tr>
<tr class="memdesc:a1606c015d02edc094bb246986159d592"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts single defragmentation pass.  <br /></td></tr>
<tr class="separator:a1606c015d02edc094bb246986159d592"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad502ba70d6dadaeee37703fd8bf90ae" id="r_aad502ba70d6dadaeee37703fd8bf90ae"><td class="memItemLeft" align="right" valign="top">HRESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aad502ba70d6dadaeee37703fd8bf90ae">EndPass</a> (<a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___p_a_s_s___m_o_v_e___i_n_f_o.html">DEFRAGMENTATION_PASS_MOVE_INFO</a> *pPassInfo)</td></tr>
<tr class="memdesc:aad502ba70d6dadaeee37703fd8bf90ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ends single defragmentation pass.  <br /></td></tr>
<tr class="separator:aad502ba70d6dadaeee37703fd8bf90ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c21c26f47dcbf8f4e562063a3e25f38" id="r_a1c21c26f47dcbf8f4e562063a3e25f38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1c21c26f47dcbf8f4e562063a3e25f38">GetStats</a> (<a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___s_t_a_t_s.html">DEFRAGMENTATION_STATS</a> *pStats)</td></tr>
<tr class="memdesc:a1c21c26f47dcbf8f4e562063a3e25f38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns statistics of the defragmentation performed so far.  <br /></td></tr>
<tr class="separator:a1c21c26f47dcbf8f4e562063a3e25f38"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents defragmentation process in progress. </p>
<p>You can create this object using <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#a08e1468f1dbb63ce3bf6680e592b2143" title="Begins defragmentation process of the default pools.">Allocator::BeginDefragmentation</a> (for default pools) or <a class="el" href="class_d3_d12_m_a_1_1_pool.html#adc87bb49c192de8f5a9ca0484c499575" title="Begins defragmentation process of the current pool.">Pool::BeginDefragmentation</a> (for a custom pool). </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a1606c015d02edc094bb246986159d592" name="a1606c015d02edc094bb246986159d592"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1606c015d02edc094bb246986159d592">&#9670;&#160;</a></span>BeginPass()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HRESULT D3D12MA::DefragmentationContext::BeginPass </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___p_a_s_s___m_o_v_e___i_n_f_o.html">DEFRAGMENTATION_PASS_MOVE_INFO</a> *</td>          <td class="paramname"><span class="paramname"><em>pPassInfo</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts single defragmentation pass. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pPassInfo</td><td>Computed informations for current pass. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li><code>S_OK</code> if no more moves are possible. Then you can omit call to <a class="el" href="#aad502ba70d6dadaeee37703fd8bf90ae" title="Ends single defragmentation pass.">DefragmentationContext::EndPass()</a> and simply end whole defragmentation.</li>
<li><code>S_FALSE</code> if there are pending moves returned in <code>pPassInfo</code>. You need to perform them, call <a class="el" href="#aad502ba70d6dadaeee37703fd8bf90ae" title="Ends single defragmentation pass.">DefragmentationContext::EndPass()</a>, and then preferably try another pass with <a class="el" href="#a1606c015d02edc094bb246986159d592" title="Starts single defragmentation pass.">DefragmentationContext::BeginPass()</a>. </li>
</ul>
</dd></dl>

</div>
</div>
<a id="aad502ba70d6dadaeee37703fd8bf90ae" name="aad502ba70d6dadaeee37703fd8bf90ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad502ba70d6dadaeee37703fd8bf90ae">&#9670;&#160;</a></span>EndPass()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HRESULT D3D12MA::DefragmentationContext::EndPass </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___p_a_s_s___m_o_v_e___i_n_f_o.html">DEFRAGMENTATION_PASS_MOVE_INFO</a> *</td>          <td class="paramname"><span class="paramname"><em>pPassInfo</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Ends single defragmentation pass. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pPassInfo</td><td>Computed informations for current pass filled by <a class="el" href="#a1606c015d02edc094bb246986159d592" title="Starts single defragmentation pass.">DefragmentationContext::BeginPass()</a> and possibly modified by you. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns <code>S_OK</code> if no more moves are possible or <code>S_FALSE</code> if more defragmentations are possible.</dd></dl>
<p>Ends incremental defragmentation pass and commits all defragmentation moves from <code>pPassInfo</code>. After this call:</p>
<ul>
<li>Allocation at <code>pPassInfo[i].pSrcAllocation</code> that had <code>pPassInfo[i].Operation ==</code> <a class="el" href="namespace_d3_d12_m_a.html#a82bb787a69699a877b4166789a30e602a29a5c20322e633f6c34ddebd16bc61ac">DEFRAGMENTATION_MOVE_OPERATION_COPY</a> (which is the default) will be pointing to the new destination place.</li>
<li>Allocation at <code>pPassInfo[i].pSrcAllocation</code> that had <code>pPassInfo[i].operation ==</code> <a class="el" href="namespace_d3_d12_m_a.html#a82bb787a69699a877b4166789a30e602aa2143507d723de458c2ed94e143ac242" title="Set this value if you decide to abandon the allocation and you destroyed the resource....">DEFRAGMENTATION_MOVE_OPERATION_DESTROY</a> will be released.</li>
</ul>
<p>If no more moves are possible you can end whole defragmentation. </p>

</div>
</div>
<a id="a1c21c26f47dcbf8f4e562063a3e25f38" name="a1c21c26f47dcbf8f4e562063a3e25f38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c21c26f47dcbf8f4e562063a3e25f38">&#9670;&#160;</a></span>GetStats()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void D3D12MA::DefragmentationContext::GetStats </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___s_t_a_t_s.html">DEFRAGMENTATION_STATS</a> *</td>          <td class="paramname"><span class="paramname"><em>pStats</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns statistics of the defragmentation performed so far. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/PROJECTS/D3D12 Memory Allocator/REPO/include/<a class="el" href="_d3_d12_mem_alloc_8h.html">D3D12MemAlloc.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
